package com.example.demo.thread.threadPool;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author: htc
 * @date: Created in 15:10 2019/2/25.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestMain {
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private AsyncTask asyncTask;

    @Test
    public void setAsyncTask() {
        for (int i = 0; i < 10000; i++) {
            asyncTask.doTask(i);
        }

        logger.info("All tasks finished.");

    }
}
